﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NAnt.Core;
using NAnt.Core.Util;
using NAnt.SVN.Util;
using NAnt.Core.Attributes;

namespace NAnt.SVN.Tasks
{
    /// <summary>
    /// Tool task to list all the set SVN properties.
    /// You can run this tasc with the svnlistproperties tag in NAnt.
    /// $Id$
    /// </summary>
    [TaskName("svnlistproperties")]
    public class SVNPropertyList : BaseExtensionTask
    {
        /// <summary>
        /// Run the task
        /// </summary>
        protected override void ExecuteTask()
        {
            string format = ResourceUtils.GetString("SVN0105");
            Dictionary<string, string> properties = PropertiesManager.ListSVNProperties();
            foreach (KeyValuePair<string, string> p in properties)
            {
                Log(Level.Info, string.Format(format, p.Key, p.Value));
            }
        }
    }
}
